#include <bits/stdc++.h>
using namespace std;
string arrs[11];
string ss;
bool hasChar(const string& s, char c) {
    int len = s.length();
    for (int i=0; i<len; ++i) {
        if (s[i] == c) return true;
    }
    return false;
}
bool hasSebque(string vec, string s) {
    int vlen = vec.length();
    int len = s.length();
    bool flag = false;
    for (int i=0; i<len; ++i) {
        if (s[i] == vec[0]) {
            int p = 1;
            int st = (i+1)%len;
            while (st != i) {
                if (p >= vlen) break;
                if (s[st] == vec[p]) ++p;
                st = (st + 1) % len;
            }
            if (p == vlen) {
                flag = true;
                break;
            }
        }
    }
    return flag;
}
string res;
int n;
void DFS(string s) {
    int len = ss.length();
    if (s.length() > res.length()) res = s;
    for (int i=0; i<len; ++i) {
        string t = s + ss[i];
        bool flag = true;
        for (int j=0; j<n; ++j) {
            if (!hasSebque(t, arrs[j])) flag = false;
        }
        if (flag) DFS(t);
    }
}

int main() {
#ifdef hai
    freopen("in.txt", "r", stdin);
#endif
    while (~scanf("%d", &n)) {
        for (int i=0; i<n; ++i) cin>>arrs[i];
        ss="";
        for (int i=0; i<26; ++i) {
            char c = 'a' + i;
            bool flag = true;
            for (int j=0; j<n; ++j) {
                if (!hasChar(arrs[j], c)) flag = false;
            }
            if (flag) ss += c;
        }
        if (ss.length()==0) {
            printf("0\n");
            continue;
        }
        res="";
        DFS("");
        cout<<res<<endl;
    }
    return 0;
}
